<?php
class SafeHavenWith2RebelsTest extends PHPUnit_Framework_TestCase {
	
	public function setUp() {
		$this->position = OPPosition::newWithLatitudeLongitude(10, 10);
		$virtualCharacter = new OPVirtualCharacter();
		$this->safeHaven = OPSafeHaven::newWithIdPositionAndVirtualCharacter(1, $this->position, $virtualCharacter);
				
		$this->aRebel = new OPRebel();
		$anotherRebel = new OPRebel();
		
		$this->safeHaven->isCapturedBy($this->aRebel);
		$this->safeHaven->addPlayer($this->aRebel)
						->addPlayer($anotherRebel);
		
	}
	
	/**
	 * @test
	 */
	public function playersInShouldBe2() {
		$this->assertEquals($this->safeHaven->playersIn(), 2);
		
	}
	
	/**
	 * @test
	 */
	public function playersInShouldBe1AfterDeletingOnePlayer() {
		$this->safeHaven->removePlayer($this->aRebel);
		
		$this->assertEquals($this->safeHaven->playersIn(), 1);
		
	}
	
	/**
	 * @test
	 */
	public function anOppressorCantBeAddedToSafeHaven() {
		$anOppressor = new OPOppressor();
		
		$this->assertFalse($this->safeHaven->addPlayer($anOppressor));
		
	}
	
}